﻿@{
    ViewBag.Title = "Group";
    Layout = null;
}
@using DDit.Core.Data.SystemEntity.Entity;
@using DDitApplicationFrame.Common;
@Styles.Render("~/Scripts/bootstrap/css/1", "~/Scripts/datatables/css/1", "~/Content/1", "~/Scripts/alertjs/themes/1", "~/Scripts/select2/css/1", "~/Scripts/iconpicker/css/1", "~/Scripts/fancyTree/skin-win7/1", "~/Scripts/fileUpload/1")
@Scripts.Render("~/bundles/js")

<script type="text/javascript">
    $(function () {
        //初始化表格配置
        var table = $('#userTable').custromTable({
            ajax: {
                url: "/WxUser/BackUser"                
            },
            columns: [
                { data: 'openid', visible: false },
                { data: 'nickname', title: "用户名" },
                { data: 'sex', title: "性别" },
                { data: 'Address', title: "所在地" },
                { data: 'remark', title: '备注' },
                { data: 'Group', title: '用户组' }
            ]            
        }); 
        
        //删除按钮操作
        $("#wxblackCancelBlack").click(function () {
            var cc = table.rows('.selected')
            if (cc[0].length > 0) {
                var model = cc.data();
                parent.layer.confirm("确定要取消黑名单！", dditConfig.hintLayer, function () {
                    $.post("/WxUser/CancelBackUser", { openid: model[0].openid }, function (data) {
                        if (data.result) {
                            cc.remove().draw(false);
                            parent.layer.close(parent.layer.index);
                            alertify.success("取消成功！");
                        } else {
                            alertify.error(data.message);
                        }
                    });
                });
            } else {
                alertify.log("请选择一条操作信息！");
            }
        });


    })

</script>

<div class="margin w100f xoverhide">
    <div class="panel panel-default" style="margin-top: 10px">
        @Html.Action("CreateButtonByMuen", "Button", new { menuId = 46, mark = "wxblack" })

    </div>
    <table id="userTable" class="table table-bordered table-striped w100f" cellspacing="0"></table>
</div>
